From 104caa74f05a376a7dd65f4b7540c6986c7781f3 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 23 Apr 2010 02:31:57 +0200 Subject: [PATCH] GtkStyleContext: Add gtk_style_context_list_child_classes(). --- gtk/gtkstylecontext.c | 25 +++++++++++++++++++++++++ gtk/gtkstylecontext.h | 2 ++ 2 files changed, 27 insertions(+) diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index f8f6c08040..c4401cc155 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -473,6 +473,31 @@ child_style_class_compare (gconstpointer p1, return (gint) c1->class_quark - c2->class_quark; } +GList * +gtk_style_context_list_child_classes (GtkStyleContext *context) +{ + GtkStyleContextPrivate *priv; + GList *classes = NULL; + GList *link; + + g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL); + + priv = GTK_STYLE_CONTEXT_GET_PRIVATE (context); + link = priv->child_style_classes; + + while (link) + { + GtkChildClass *link_class; + + link_class = link->data; + classes = g_list_prepend (classes, + g_quark_to_string (link_class->class_quark)); + link = link->next; + } + + return classes; +} + void gtk_style_context_set_child_class (GtkStyleContext *context, const gchar *class_name, diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h index a9ddd75e7a..2ef9ee12c9 100644 --- a/gtk/gtkstylecontext.h +++ b/gtk/gtkstylecontext.h @@ -84,6 +84,8 @@ void gtk_style_context_unset_class (GtkStyleContext *context, gboolean gtk_style_context_has_class (GtkStyleContext *context, const gchar *class_name); +GList * gtk_style_context_list_child_classes (GtkStyleContext *context); + void gtk_style_context_set_child_class (GtkStyleContext *context, const gchar *class_name, GtkChildClassFlags flags); -- 2.30.2